/******************************************************************************\
 *                                                                            *
 *                         Define Constant Stuff                              *
 *                   Flavio Bertini fl.bertini@gmail.com                      *
 *                                                                            *
 *                                                                            *
\******************************************************************************/

#if !defined(__Const_h__)
#define __Const_h__

// leap stuff
#define LEAP_ZOOM_GAP     1
#define LEAP_XZ_PLANE  -200.0           // translate the LEAP's xz-plane -200mm
#define LEAP_SCALE        0.00003       // scale factor of radius circle gesture
#define LEAP_FFCLOSE      0             // five closed fingers
#define LEAP_OFOPEN       1             // one opened fingers
#define LEAP_TFOPEN       2             // two opened fingers
#define LEAP_FFOPEN       4             // four opened fingers
#define LEAP_HFOPEN       5             // five opened fingers
#define X                 0
#define Y                 1
#define Z                 2

// camera stuff
#define GL_LOOK_RHO     474.341649025   // rho of the initial lookAt vector
#define GL_ZOOM_INC       2.0
#define GL_NVISION        3
#define GL_VMONO          0
#define GL_VMULTI         1
#define GL_VANAGLYPH      2
#define GL_EYESEP         6           // real eye distance
#define GL_FOV           45.0
#define GL_FOL          -90.0         // 45.0° Field of View correspond to 52.2274 Focal Length
                                      // http://www.bdimitrov.de/kmp/technology/fov.html but it
                                      // has been changed to produce the inside / outside effect

// global camera
static const GLdouble GL_LOOK_AT_X = 0.0;
static const GLdouble GL_LOOK_AT_Y = 200.0;
static const GLdouble GL_LOOK_AT_Z = 450.0;
static const GLdouble GL_LOOK_TO_X = 0.0;
static const GLdouble GL_LOOK_TO_Y = 150.0;
static const GLdouble GL_LOOK_TO_Z = 200.0;
static const GLdouble GL_LOOK_UP_X = 0.0;
static const GLdouble GL_LOOK_UP_Y = 1.0;
static const GLdouble GL_LOOK_UP_Z = 0.0;
// front camera
static const GLdouble GL_LOOK_AT_FX = 0.0;
static const GLdouble GL_LOOK_AT_FY = 150.0;
static const GLdouble GL_LOOK_AT_FZ = 500.0;
static const GLdouble GL_LOOK_TO_FX = 0.0;
static const GLdouble GL_LOOK_TO_FY = 150.0;
static const GLdouble GL_LOOK_TO_FZ = 0.0;
// side camera
static const GLdouble GL_LOOK_AT_SX = 550.0;
static const GLdouble GL_LOOK_AT_SY = 150.0;
static const GLdouble GL_LOOK_AT_SZ = 0.0;
static const GLdouble GL_LOOK_TO_SX = 0.0;
static const GLdouble GL_LOOK_TO_SY = 150.0;
static const GLdouble GL_LOOK_TO_SZ = 0.0;
// top camera
static const GLdouble GL_LOOK_AT_TX = 0.1;
static const GLdouble GL_LOOK_AT_TY = 500.0;
static const GLdouble GL_LOOK_AT_TZ = 0.0;
static const GLdouble GL_LOOK_TO_TX = 0.0;
static const GLdouble GL_LOOK_TO_TY = 0.0;
static const GLdouble GL_LOOK_TO_TZ = 0.0;
static const GLdouble GL_LOOK_UP_TX = 0.0;
static const GLdouble GL_LOOK_UP_TY = 0.0;
static const GLdouble GL_LOOK_UP_TZ = -1.0;


// colors
static const GLfloat GL_BLU_COLOR[3]      = {0.0, 0.0, 1.0};
static const GLfloat GL_WHITE_COLOR[3]    = {1.0, 1.0, 1.0};
static const GLfloat GL_GREEN_COLOR[3]    = {0.0, 1.0, 0.0};
static const GLfloat GL_GREY_COLOR[3]     = {0.7, 0.7, 0.7};
static const GLfloat GL_RED_COLOR[3]      = {1.0, 0.0, 0.0};
static const GLfloat GL_SOFTRED_COLOR[3]  = {0.7843, 0.0588, 0.0};
static const GLfloat GL_SOFTGREY_COLOR[3] = {0.8235, 0.8235, 0.8235};
static const GLfloat GL_YELLOW_COLOR[3]   = {1.0, 1.0, 0.0};
static const GLfloat GL_VIOLET_COLOR[3]   = {0.9882, 0.0588, 0.7529};
static const GLfloat GL_MARINE_COLOR[3]   = {0.4980, 1.0, 0.5215};
#define GL_NUM_COLORH 4
static const GLfloat* GL_COLOR_H[GL_NUM_COLORH] __attribute__ ((unused)) = {GL_GREEN_COLOR, GL_YELLOW_COLOR, GL_VIOLET_COLOR, GL_MARINE_COLOR};


static const GLfloat GL_WHITE_COLORA[4]    = {1.0, 1.0, 1.0, 0.1};
static const GLfloat GL_LBLUE_COLORA[4]   = {0.53, 0.81, 0.98, 0.32};
static const GLfloat GL_LGREEN_COLORA[4]  = {0.2, 1.0, 0.2, 0.25};
static const GLfloat GL_LRED_COLORA[4]    = {1.0, 0.27, 0.0, 0.25};
static const GLfloat GL_LVIOLET_COLORA[4] = {0.93, 0.51, 0.93, 0.25};
static const GLfloat GL_LYELLOW_COLORA[4] = {1.0, 1.0, 0.35, 0.28};
#define GL_NUM_COLORA 5
static const GLfloat* GL_COLOR_V[GL_NUM_COLORA] __attribute__ ((unused)) = {GL_LRED_COLORA, GL_LGREEN_COLORA, GL_LYELLOW_COLORA, GL_LBLUE_COLORA, GL_LVIOLET_COLORA};
static const GLfloat GL_GREY_CYLI[4]   = {0.68, 0.68, 0.68, 0.15};

// other
#define KEY_ESCAPE 27
#define AMAXVALUE  1000000000
#define AMINVALUE -1000000000
#define NULLREF   -1

// mode
#define NAPPMODE 6
static const char* CAMERA    = "Camera mode";
static const char* OBJECT    = "Object mode";
static const char* EDIT      = "Edit mode";
static const char* CUT       = "Cut mode";
static const char* BOOLEAN   = "Boolean mode";
static const char* SCULPTURE = "Sculpture mode";
static const char* APPMODES[NAPPMODE] __attribute__ ((unused)) = {CAMERA, OBJECT, EDIT, CUT, BOOLEAN, SCULPTURE};

// hand type
#define LEFTH    0
#define RIGHTH   1

#define SSRADIUS         20.0
#define SSRADIUS_SCALE   0.0001       // scale factor of radius selection sphere

#define MIN_RCAPTURE     40.0
#define MAX_RCAPTURE     80.0

// geometric action
#define DESELECT_POINT 0
#define SELECT_POINT   1

#define MINXSP  -80.0f
#define MAXXSP   80.0f
#define MINZSP -120.0f
#define MAXZSP   40.0f

#endif // __Const_h__
